package com.huangsm.concurrence.blockingqueue;

import lombok.AllArgsConstructor;

import java.util.concurrent.BlockingQueue;

/**
 * @author huang
 * @PACKAGE_NAME com.huangsm.concurrence.blocking
 * @PROJECT_NAME concurrence
 * @date 2019/2/14
 */
@AllArgsConstructor
public class Producer implements Runnable{
    protected BlockingQueue queue=null;

    @Override
    public void run() {
        try {
            queue.put("1");
            Thread.sleep(1000);
            queue.put("2");
            Thread.sleep(1000);
            queue.put("3");
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }
}
